//
//  NewMenuTab.h
//  Qianbao
//
//  Created by zhangtie on 13-12-16.
//  Copyright (c) 2013年 qianwang365. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CustomTabModel.h"

#define KEY_DATATITLE       @"data_title"
#define KEY_DATAVIEW        @"data_view"

#define kMENUHEADHEIGHT     40

#define SPAN_WIDTH  2.0f

typedef enum _MENULAYOUT
{
    MENULAYOUT_DEFAULT,     //上下排版
    MENULAYOUT_COVER,       //menu覆盖在主体上
}MENULAYOUT;

@class CustomTabItem;
@class NewMenuTab;
@protocol NewMenuTabDelegate <NSObject>

@optional
- (void)doTabItemClick:(NewMenuTab*)sender withItem:(CustomTabItem*)item;

@end

@interface NewMenuTab : UIView

@property (nonatomic, assign  ) id<NewMenuTabDelegate> delegate;

@property (nonatomic, assign  ) MENULAYOUT         menuLayout;

//数据源
@property (nonatomic, retain  ) NSArray            *menus;

//属性设置
@property (nonatomic, assign  ) BOOL               isNeedDefaultSelectedEvent; //default is YES
@property (nonatomic          ) NSInteger          menuHeadHeight; //头部menutitle的高度
@property (nonatomic, assign  ) BOOL               isCoverage; //宽度是否均分,默认均分
@property (nonatomic, assign  ) CGFloat            itemWidth; //isCoverage为NO时候有用
@property (nonatomic, assign  ) CGFloat            itemSpace; //间距,默认是0

@property (nonatomic, assign  ) CGFloat            orginY;

@property (nonatomic, assign  ) BOOL               changeAnimal; //切换时候是否启用动画
@property (nonatomic, assign  ) CGFloat            font_size;
@property (nonatomic, assign  ) NSInteger          ndefaultSelectedIndex;
@property (nonatomic, retain  ) UIColor            * color_selected;
@property (nonatomic, retain  ) UIColor            * color_normal;
@property (nonatomic, retain  ) UIColor            * color_textSelected;
@property (nonatomic, retain  ) UIColor            * color_textNormal;
@property (nonatomic, assign  ) BOOL               canMove; //default is YES
@property (nonatomic, readonly) UIScrollView       *menuHead;
@property (nonatomic, assign  ) BOOL               isNeedSpanLine;  //是否需要分隔线default is YES
@property (nonatomic, assign  ) BOOL               showSignImage;   //default is Yes
@property (nonatomic, retain  ) NSString           *imageSignName;  //head下面标记图片名

//对外提供的只读属性
@property (nonatomic, readonly) NSInteger          ncurrentSelectedIndex;
@property (nonatomic, readonly) CGRect             viewFrame;

//行为:操作subview
- (BOOL)isBodyContainView:(UIView*)subView;
- (void)addSubviewToBody:(UIView*)subView;

- (void)setMenuItemSelectedAtIndex:(NSInteger)index;

- (void)setMenuHeadVisible:(BOOL)bshow;

- (UIView*)viewAtIndex:(NSInteger)index;

@end
